package day0220;

import java.util.Scanner;

public class Test2 {
    public static void main(String[] args) {
        // 1.0/2.0   2.0/3.0    3.0/4.0    4.0/5.0   5.0/6.0.....
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入一个整数count，表示数列前count项的和：");
        int count=sc.nextInt();
        double sum=0;
        for (double i = 1; i <= count ; i++) {
            sum= sum+i/(i+1);
        }
        System.out.println(sum);

    }
}
